Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@ledgerhq/logs
Advanced tools
@ledgerhq/logs is an npm package designed to facilitate logging within applications that interact with Ledger hardware wallets. It provides a simple and consistent way to log messages, which can be useful for debugging and monitoring the behavior of applications.
Basic Logging
This feature allows you to log messages with a specific type and level. In this example, 'apdu' is the type, 'message' is the content, and 'debug' is the level of the log.
const { log } = require('@ledgerhq/logs');
log('apdu', 'message', 'debug');
Custom Log Listener
You can set up a custom listener to handle log messages. This example demonstrates how to listen for log events and print them to the console.
const { listen } = require('@ledgerhq/logs');
listen(log => {
console.log(log.type, log.message, log.level);
});
Winston is a versatile logging library for Node.js that supports multiple transports (e.g., console, file, HTTP). It is more feature-rich compared to @ledgerhq/logs, offering advanced features like log levels, custom formats, and more.
Bunyan is another logging library for Node.js that focuses on JSON output for structured logging. It provides features like log levels, serializers, and streams. Bunyan is more suitable for applications that require structured logs and advanced logging capabilities.
Pino is a fast and low-overhead logging library for Node.js. It is designed for high-performance logging and provides features like log levels, serializers, and transports. Pino is ideal for applications that need efficient and performant logging.
Utility library that is used by all Ledger libraries to dispatch logs so we can deal with them in a unified way.
A Log object
Type: {type: string, message: string?, data: any?, id: string, date: Date}
log something
type
string a namespaced identifier of the log (it is not a level like "debug", "error" but more like "apdu-in", "apdu-out", etc...)message
string? a clear message of the log associated to the typedata
any?listen to logs.
cb
function (Log): void that is called for each future log() with the Log objectReturns Unsubscribe a function that can be called to unsubscribe the listener
FAQs
Ledger logs central point
The npm package @ledgerhq/logs receives a total of 160,579 weekly downloads. As such, @ledgerhq/logs popularity was classified as popular.
We found that @ledgerhq/logs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 21 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.